import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/Login.vue'
import Main from '../views/main.vue'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect:'/login' },
  { path: '/login', component: Login },
  {
    path: '/main', component: Main,
    children: [
      // 路由抽定向,定向到home界面
      { path: '/', redirect:'/home' },
      { path: '/home', component: () => import('../components/Home.vue') },
      { path: '/community', component: () => import('../components/Community.vue') },
      { path: '/store', component: () => import('../components/store.vue') },
      { path: '/courierStation', component: () => import('../components/courierStation.vue') },
      { path: '/commodity', component: () => import('../components/commodity.vue') },
      { path: '/mgtshop', component: () => import('../components/mgtshop.vue') },
    ]
  },
  
  
  // {
  //   path: '/',
  //   name: 'home',
  //   component: HomeView
  // },
  // {
  //   path: '/about',
  //   name: 'about',
  //   component: () => import('../views/AboutView.vue')
  // }
]

const router = new VueRouter({
  routes
})

export default router
